package com.invengo.library_orionstar;

import android.app.Application;
import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

import me.goldze.mvvmhabit.utils.KLog;

public class RobotProcessObserver implements LifecycleObserver {
    private static final String TAG = RobotProcessObserver.class.getName();


    private Application application;

    public RobotProcessObserver(Application application) {
        this.application = application;
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void onCreate() {
        KLog.e(TAG, "开始启动。。。");
        RobotManager.getInstance().connectRobot(application);
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void onPause() {
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    public void onStop() {
        Log.e(TAG, "程序onStop了");
    }
}
